﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MBSBusinessEntities;
using System.Transactions;
using MBSVO;

namespace MBSBLC
{
    public partial class BLC
    {
        #region Food

        public List<FoodVO> getAllFoodItems()
        {
            List<FoodVO> lstFood = new List<FoodVO>();
            FoodBE foodEntity = new FoodBE();
            List<FoodBE> lstFoodEntity = foodEntity.getAllFoodItems();
            foreach (FoodBE food in lstFoodEntity)
            {
                FoodVO foodItem = new FoodVO();
                foodItem.FoodID = food.FoodID;
                foodItem.ImageUrl = food.ImageUrl;
                foodItem.Name = food.Name;
                foodItem.Price = food.Price;
                foodItem.Category = food.Category;
                foodItem.IsDeleted = foodItem.IsDeleted;
                lstFood.Add(foodItem);
            }
            return lstFood;
        }

        public FoodVO getFoodItemByID(int id)
        {
            FoodBE food = new FoodBE();
            food = (FoodBE)food.GetByID(id);
            FoodVO foodItem = new FoodVO();
            foodItem.FoodID = food.FoodID;
            foodItem.ImageUrl = food.ImageUrl;
            foodItem.Name = food.Name;
            foodItem.Price = food.Price;
            foodItem.Category = food.Category;
            foodItem.IsDeleted = foodItem.IsDeleted;
            return foodItem;

        }

        public bool addFoodItem(int id, string category, string name, string imgUrl, decimal price)
        {
            FoodBE foodEntity = new FoodBE();
            foodEntity.FoodID = id;
            foodEntity.Category = category;
            foodEntity.Name = name;
            foodEntity.ImageUrl = imgUrl;
            foodEntity.Price = price;
            return foodEntity.Add();

        }

        public bool deleteFoodItem(int id)
        {
            FoodBE foodEntity = new FoodBE();
            return foodEntity.Delete(id);
        }
        #endregion
    }
}
